package com.kk.mybatis.util;

import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType;
import org.mybatis.generator.internal.types.JavaTypeResolverDefaultImpl;

/**
 * @description:
 * @author: Kk
 * @create: 2020-11-27 17:05
 **/
public class JavaTypeResolverImplUtil extends JavaTypeResolverDefaultImpl {
    /**
     * 将tinyint转换为Integer，这里是关键所在
     */
    public JavaTypeResolverImplUtil() {
        super();
        super.typeMap.put(-6,
                new JavaTypeResolverDefaultImpl.JdbcTypeInformation("TINYINT",
                        new FullyQualifiedJavaType(Integer.class.getName())));
    }
}
